package hu.mapro.rollerx.core;

import com.badlogic.gdx.math.Vector2;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.operation.buffer.BufferParameters;

public class Ground2 extends AbstractGround {

	float SIZE = 100;
	
	@Override
	public Vector2 getCarPosition(float carWidth, float carHeight) {
		return new Vector2(-carWidth/2, -getHeight(carHeight)/2);
	}

	float getHeight(float carHeight) {
		return carHeight*2;
	}

	@Override
	Vector2[][] generateVertices(float carWidth, float carHeight) {
		BufferParameters bufferParameters = new BufferParameters();
		
		return Grounds.createCave(new Coordinate[] {
				new Coordinate(-carWidth, 0.0),
				new Coordinate(SIZE, 0.0),
				new Coordinate(SIZE/2, SIZE/2),
				new Coordinate(SIZE/2, -SIZE/2),
		}, bufferParameters, getHeight(carHeight));
	}

}
